home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1996-02-20 | 8.3 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Feb 20 20:12:49 1996, modified Tue Feb 20 20:12:49 1996, creator 'CWIE', type ASCII, 7757 bytes "DefaultScanner.c" , at 0x1ecd 410 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 10 44 65 66 61 75 6c | 74 53 63 61 6e 6e 65 72 |..Defaul|tScanner|
|00000010| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.c......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 1e 4d 00 | 00 01 9a ad 50 22 11 ad |......M.|....P"..|
|00000060| 50 22 11 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |P"......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 2a b3 00 00 |........|....*...|
|00000080| 0d 2f 2a 20 73 74 61 6e | 64 61 72 64 20 68 65 61 |./* stan|dard hea|
|00000090| 64 65 72 73 20 2a 2f 0d | 23 69 6e 63 6c 75 64 65 |ders */.|#include|
|000000a0| 20 3c 63 74 79 70 65 2e | 68 3e 0d 23 69 6e 63 6c | <ctype.|h>.#incl|
|000000b0| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0d 23 69 |ude <std|io.h>.#i|
|000000c0| 6e 63 6c 75 64 65 20 3c | 73 74 72 69 6e 67 2e 68 |nclude <|string.h|
|000000d0| 3e 0d 0d 2f 2a 20 73 79 | 73 74 65 6d 20 68 65 61 |>../* sy|stem hea|
|000000e0| 64 65 72 73 20 2a 2f 0d | 23 69 6e 63 6c 75 64 65 |ders */.|#include|
|000000f0| 20 3c 53 74 72 69 6e 67 | 73 2e 68 3e 0d 23 69 6e | <String|s.h>.#in|
|00000100| 63 6c 75 64 65 20 3c 54 | 65 78 74 55 74 69 6c 73 |clude <T|extUtils|
|00000110| 2e 68 3e 0d 0d 2f 2a 20 | 63 6f 6d 70 69 6c 65 72 |.h>../* |compiler|
|00000120| 20 68 65 61 64 65 72 73 | 20 2a 2f 0d 23 69 6e 63 | headers| */.#inc|
|00000130| 6c 75 64 65 20 3c 41 34 | 53 74 75 66 66 2e 68 3e |lude <A4|Stuff.h>|
|00000140| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 44 72 6f 70 49 |.#includ|e <DropI|
|00000150| 6e 43 6f 6d 70 69 6c 65 | 72 2e 68 3e 0d 0d 2f 2a |nCompile|r.h>../*|
|00000160| 20 70 72 6f 6a 65 63 74 | 20 68 65 61 64 65 72 73 | project| headers|
|00000170| 20 2a 2f 0d 23 69 6e 63 | 6c 75 64 65 20 22 54 6f | */.#inc|lude "To|
|00000180| 6f 6c 46 72 6f 6e 74 45 | 6e 64 2e 68 22 0d 23 69 |olFrontE|nd.h".#i|
|00000190| 6e 63 6c 75 64 65 20 22 | 46 75 6c 6c 50 61 74 68 |nclude "|FullPath|
|000001a0| 2e 68 22 0d 0d 0d 70 61 | 73 63 61 6c 20 4f 53 45 |.h"...pa|scal OSE|
|000001b0| 72 72 09 6d 61 69 6e 28 | 54 6f 6f 6c 46 72 6f 6e |rr.main(|ToolFron|
|000001c0| 74 45 6e 64 53 74 61 74 | 75 73 2a 20 73 74 61 74 |tEndStat|us* stat|
|000001d0| 75 73 29 3b 0d 73 74 61 | 74 69 63 20 4f 53 45 72 |us);.sta|tic OSEr|
|000001e0| 72 09 50 72 6f 63 65 73 | 73 46 69 6c 65 28 54 6f |r.Proces|sFile(To|
|000001f0| 6f 6c 46 72 6f 6e 74 45 | 6e 64 53 74 61 74 75 73 |olFrontE|ndStatus|
|00000200| 2a 20 73 74 61 74 75 73 | 2c 20 63 6f 6e 73 74 20 |* status|, const |
|00000210| 46 53 53 70 65 63 2a 20 | 73 70 65 63 2c 20 0d 09 |FSSpec* |spec, ..|
|00000220| 09 09 09 09 09 09 48 61 | 6e 64 6c 65 20 68 61 6e |......Ha|ndle han|
|00000230| 64 2c 20 6c 6f 6e 67 20 | 73 69 7a 65 2c 20 42 6f |d, long |size, Bo|
|00000240| 6f 6c 65 61 6e 20 69 73 | 49 6e 63 6c 75 64 65 46 |olean is|IncludeF|
|00000250| 69 6c 65 29 3b 0d 73 74 | 61 74 69 63 20 4f 53 45 |ile);.st|atic OSE|
|00000260| 72 72 09 50 61 72 73 65 | 54 65 78 74 28 54 6f 6f |rr.Parse|Text(Too|
|00000270| 6c 46 72 6f 6e 74 45 6e | 64 53 74 61 74 75 73 2a |lFrontEn|dStatus*|
|00000280| 20 73 74 61 74 75 73 2c | 20 63 6f 6e 73 74 20 63 | status,| const c|
|00000290| 68 61 72 2a 20 74 65 78 | 74 29 3b 0d 73 74 61 74 |har* tex|t);.stat|
|000002a0| 69 63 20 4f 53 45 72 72 | 09 49 6e 63 6c 75 64 65 |ic OSErr|.Include|
|000002b0| 46 69 6c 65 28 54 6f 6f | 6c 46 72 6f 6e 74 45 6e |File(Too|lFrontEn|
|000002c0| 64 53 74 61 74 75 73 2a | 20 73 74 61 74 75 73 2c |dStatus*| status,|
|000002d0| 20 63 6f 6e 73 74 20 63 | 68 61 72 2a 20 69 6e 63 | const c|har* inc|
|000002e0| 6c 6e 61 6d 65 2c 20 42 | 6f 6f 6c 65 61 6e 20 66 |lname, B|oolean f|
|000002f0| 75 6c 6c 53 65 61 72 63 | 68 29 3b 0d 73 74 61 74 |ullSearc|h);.stat|
|00000300| 69 63 20 4f 53 45 72 72 | 09 52 65 61 64 4f 6e 65 |ic OSErr|.ReadOne|
|00000310| 46 69 6c 65 28 54 6f 6f | 6c 46 72 6f 6e 74 45 6e |File(Too|lFrontEn|
|00000320| 64 53 74 61 74 75 73 2a | 20 73 74 61 74 75 73 2c |dStatus*| status,|
|00000330| 20 63 6f 6e 73 74 20 46 | 53 53 70 65 63 2a 20 73 | const F|SSpec* s|
|00000340| 70 65 63 2c 20 0d 09 09 | 09 09 09 09 09 48 61 6e |pec, ...|.....Han|
|00000350| 64 6c 65 20 68 61 6e 64 | 2c 20 6c 6f 6e 67 20 73 |dle hand|, long s|
|00000360| 69 7a 65 2c 20 42 6f 6f | 6c 65 61 6e 20 69 73 49 |ize, Boo|lean isI|
|00000370| 6e 63 6c 75 64 65 46 69 | 6c 65 2c 20 48 61 6e 64 |ncludeFi|le, Hand|
|00000380| 6c 65 2a 20 74 65 78 74 | 70 29 3b 0d 0d 0d 0d 70 |le* text|p);....p|
|00000390| 61 73 63 61 6c 20 4f 53 | 45 72 72 20 6d 61 69 6e |ascal OS|Err main|
|000003a0| 28 54 6f 6f 6c 46 72 6f | 6e 74 45 6e 64 53 74 61 |(ToolFro|ntEndSta|
|000003b0| 74 75 73 2a 20 73 74 61 | 74 75 73 29 0d 7b 0d 09 |tus* sta|tus).{..|
|000003c0| 4f 53 45 72 72 20 65 72 | 72 3b 0d 09 0d 09 2f 2a |OSErr er|r;..../*|
|000003d0| 20 73 65 74 20 75 70 20 | 67 6c 6f 62 61 6c 20 77 | set up |global w|
|000003e0| 6f 72 6c 64 20 28 36 38 | 4b 20 6f 6e 6c 79 29 20 |orld (68|K only) |
|000003f0| 2a 2f 0d 09 45 6e 74 65 | 72 43 6f 64 65 52 65 73 |*/..Ente|rCodeRes|
|00000400| 6f 75 72 63 65 28 29 3b | 0d 09 0d 09 73 74 61 74 |ource();|....stat|
|00000410| 75 73 2d 3e 73 63 61 6e | 53 74 61 74 75 73 20 3d |us->scan|Status =|
|00000420| 20 4e 55 4c 4c 3b 0d 09 | 0d 09 65 72 72 20 3d 20 | NULL;..|..err = |
|00000430| 50 72 6f 63 65 73 73 46 | 69 6c 65 28 73 74 61 74 |ProcessF|ile(stat|
|00000440| 75 73 2c 20 26 73 74 61 | 74 75 73 2d 3e 63 70 62 |us, &sta|tus->cpb|
|00000450| 2d 3e 73 6f 75 72 63 65 | 66 69 6c 65 2c 20 73 74 |->source|file, st|
|00000460| 61 74 75 73 2d 3e 63 70 | 62 2d 3e 73 6f 75 72 63 |atus->cp|b->sourc|
|00000470| 65 68 61 6e 64 6c 65 2c | 0d 09 09 09 09 09 09 73 |ehandle,|.......s|
|00000480| 74 61 74 75 73 2d 3e 63 | 70 62 2d 3e 73 6f 75 72 |tatus->c|pb->sour|
|00000490| 63 65 68 61 6e 64 6c 65 | 73 69 7a 65 2c 20 66 61 |cehandle|size, fa|
|000004a0| 6c 73 65 29 3b 0d 09 0d | 09 2f 2a 20 74 65 61 72 |lse);...|./* tear|
|000004b0| 20 64 6f 77 6e 20 67 6c | 6f 62 61 6c 20 77 6f 72 | down gl|obal wor|
|000004c0| 6c 64 20 28 36 38 4b 20 | 6f 6e 6c 79 29 20 2a 2f |ld (68K |only) */|
|000004d0| 0d 09 45 78 69 74 43 6f | 64 65 52 65 73 6f 75 72 |..ExitCo|deResour|
|000004e0| 63 65 28 29 3b 0d 09 0d | 09 72 65 74 75 72 6e 20 |ce();...|.return |
|000004f0| 65 72 72 3b 0d 7d 0d 0d | 0d 73 74 61 74 69 63 20 |err;.}..|.static |
|00000500| 4f 53 45 72 72 09 50 72 | 6f 63 65 73 73 46 69 6c |OSErr.Pr|ocessFil|
|00000510| 65 28 54 6f 6f 6c 46 72 | 6f 6e 74 45 6e 64 53 74 |e(ToolFr|ontEndSt|
|00000520| 61 74 75 73 2a 20 73 74 | 61 74 75 73 2c 20 63 6f |atus* st|atus, co|
|00000530| 6e 73 74 20 46 53 53 70 | 65 63 2a 20 73 70 65 63 |nst FSSp|ec* spec|
|00000540| 2c 20 0d 09 09 09 09 09 | 09 09 48 61 6e 64 6c 65 |, ......|..Handle|
|00000550| 20 68 61 6e 64 2c 20 6c | 6f 6e 67 20 73 69 7a 65 | hand, l|ong size|
|00000560| 2c 20 42 6f 6f 6c 65 61 | 6e 20 69 73 49 6e 63 6c |, Boolea|n isIncl|
|00000570| 75 64 65 46 69 6c 65 29 | 0d 7b 0d 09 48 61 6e 64 |udeFile)|.{..Hand|
|00000580| 6c 65 09 74 65 78 74 3b | 0d 09 4f 53 45 72 72 09 |le.text;|..OSErr.|
|00000590| 65 72 72 3b 0d 09 42 79 | 74 65 09 73 74 61 74 65 |err;..By|te.state|
|000005a0| 3b 0d 09 0d 09 2f 2a 20 | 72 65 61 64 20 69 6e 20 |;..../* |read in |
|000005b0| 74 68 65 20 74 65 78 74 | 20 26 20 63 61 63 68 65 |the text| & cache|
|000005c0| 20 69 74 20 2a 2f 0d 09 | 65 72 72 20 3d 20 52 65 | it */..|err = Re|
|000005d0| 61 64 4f 6e 65 46 69 6c | 65 28 73 74 61 74 75 73 |adOneFil|e(status|
|000005e0| 2c 20 73 70 65 63 2c 20 | 68 61 6e 64 2c 20 73 69 |, spec, |hand, si|
|000005f0| 7a 65 2c 20 69 73 49 6e | 63 6c 75 64 65 46 69 6c |ze, isIn|cludeFil|
|00000600| 65 2c 20 26 74 65 78 74 | 29 3b 0d 09 69 66 20 28 |e, &text|);..if (|
|00000610| 65 72 72 20 21 3d 20 6e | 6f 45 72 72 29 20 72 65 |err != n|oErr) re|
|00000620| 74 75 72 6e 20 65 72 72 | 3b 0d 09 0d 09 2f 2a 20 |turn err|;..../* |
|00000630| 70 72 6f 63 65 73 73 20 | 74 68 65 20 74 65 78 74 |process |the text|
|00000640| 20 2a 2f 0d 09 73 74 61 | 74 65 20 3d 20 48 47 65 | */..sta|te = HGe|
|00000650| 74 53 74 61 74 65 28 74 | 65 78 74 29 3b 0d 09 48 |tState(t|ext);..H|
|00000660| 4c 6f 63 6b 28 74 65 78 | 74 29 3b 0d 09 65 72 72 |Lock(tex|t);..err|
|00000670| 20 3d 20 50 61 72 73 65 | 54 65 78 74 28 73 74 61 | = Parse|Text(sta|
|00000680| 74 75 73 2c 20 2a 74 65 | 78 74 29 3b 0d 09 48 53 |tus, *te|xt);..HS|
|00000690| 65 74 53 74 61 74 65 28 | 74 65 78 74 2c 20 73 74 |etState(|text, st|
|000006a0| 61 74 65 29 3b 0d 09 0d | 09 2f 2a 20 72 65 6c 65 |ate);...|./* rele|
|000006b0| 61 73 65 20 74 68 65 20 | 74 65 78 74 20 2a 2f 0d |ase the |text */.|
|000006c0| 09 28 76 6f 69 64 29 20 | 43 57 43 6f 6d 70 46 72 |.(void) |CWCompFr|
|000006d0| 65 65 49 6e 63 6c 75 64 | 65 46 69 6c 65 28 73 74 |eeInclud|eFile(st|
|000006e0| 61 74 75 73 2d 3e 63 70 | 62 2c 20 74 65 78 74 29 |atus->cp|b, text)|
|000006f0| 3b 0d 0d 09 72 65 74 75 | 72 6e 20 65 72 72 3b 0d |;...retu|rn err;.|
|00000700| 7d 0d 0d 0d 73 74 61 74 | 69 63 20 4f 53 45 72 72 |}...stat|ic OSErr|
|00000710| 09 50 61 72 73 65 54 65 | 78 74 28 54 6f 6f 6c 46 |.ParseTe|xt(ToolF|
|00000720| 72 6f 6e 74 45 6e 64 53 | 74 61 74 75 73 2a 20 73 |rontEndS|tatus* s|
|00000730| 74 61 74 75 73 2c 20 63 | 6f 6e 73 74 20 63 68 61 |tatus, c|onst cha|
|00000740| 72 2a 20 74 65 78 74 29 | 0d 7b 0d 09 63 6f 6e 73 |r* text)|.{..cons|
|00000750| 74 20 63 68 61 72 09 69 | 6e 63 6c 74 6f 6b 5b 5d |t char.i|ncltok[]|
|00000760| 09 3d 20 22 69 6e 63 6c | 75 64 65 22 3b 0d 09 73 |.= "incl|ude";..s|
|00000770| 69 7a 65 5f 74 09 09 69 | 6e 63 6c 6c 65 6e 09 09 |ize_t..i|ncllen..|
|00000780| 3d 20 73 74 72 6c 65 6e | 28 69 6e 63 6c 74 6f 6b |= strlen|(incltok|
|00000790| 29 3b 0d 09 4f 53 45 72 | 72 09 09 65 72 72 20 3d |);..OSEr|r..err =|
|000007a0| 20 6e 6f 45 72 72 3b 0d | 09 09 0d 09 2f 2a 0d 09 | noErr;.|..../*..|
|000007b0| 20 2a 09 50 72 6f 63 65 | 73 73 20 74 68 65 20 73 | *.Proce|ss the s|
|000007c0| 6f 75 72 63 65 20 66 69 | 6c 65 20 74 65 78 74 2e |ource fi|le text.|
|000007d0| 0d 09 20 2a 0d 09 20 2a | 20 20 4c 6f 6f 6b 20 66 |.. *.. *| Look f|
|000007e0| 6f 72 20 23 69 6e 63 6c | 75 64 65 20 73 74 61 74 |or #incl|ude stat|
|000007f0| 65 6d 65 6e 74 73 20 61 | 74 20 74 68 65 20 62 65 |ements a|t the be|
|00000800| 67 69 6e 6e 69 6e 67 20 | 6f 66 20 65 76 65 72 79 |ginning |of every|
|00000810| 20 6c 69 6e 65 2c 0d 09 | 20 2a 09 74 68 65 6e 20 | line,..| *.then |
|00000820| 6f 70 65 6e 20 74 68 65 | 20 73 70 65 63 69 66 69 |open the| specifi|
|00000830| 65 64 20 66 69 6c 65 20 | 61 6e 64 20 70 72 6f 63 |ed file |and proc|
|00000840| 65 73 73 20 69 74 20 72 | 65 63 75 72 73 69 76 65 |ess it r|ecursive|
|00000850| 6c 79 2e 0d 09 20 2a 2f | 0d 09 0d 09 77 68 69 6c |ly... */|....whil|
|00000860| 65 20 28 28 65 72 72 20 | 3d 3d 20 6e 6f 45 72 72 |e ((err |== noErr|
|00000870| 29 20 26 26 20 28 2a 74 | 65 78 74 20 21 3d 20 27 |) && (*t|ext != '|
|00000880| 5c 30 27 29 29 0d 09 7b | 0d 09 09 2f 2a 20 61 74 |\0'))..{|.../* at|
|00000890| 20 74 68 65 20 74 6f 70 | 20 6f 66 20 74 68 65 20 | the top| of the |
|000008a0| 6c 6f 6f 70 2c 20 77 65 | 27 72 65 20 61 74 20 74 |loop, we|'re at t|
|000008b0| 68 65 20 62 65 67 69 6e | 6e 69 6e 67 20 6f 66 20 |he begin|ning of |
|000008c0| 61 20 6c 69 6e 65 20 2a | 2f 0d 09 09 0d 09 09 63 |a line *|/......c|
|000008d0| 68 61 72 09 63 3b 0d 09 | 09 0d 09 09 2f 2a 20 73 |har.c;..|..../* s|
|000008e0| 6b 69 70 20 77 68 69 74 | 65 20 73 70 61 63 65 20 |kip whit|e space |
|000008f0| 28 62 75 74 20 6e 6f 74 | 20 63 61 72 72 69 61 67 |(but not| carriag|
|00000900| 65 20 72 65 74 75 72 6e | 73 29 20 2a 2f 0d 09 09 |e return|s) */...|
|00000910| 77 68 69 6c 65 20 28 28 | 28 63 20 3d 20 2a 74 65 |while ((|(c = *te|
|00000920| 78 74 29 20 21 3d 20 27 | 5c 72 27 29 20 26 26 20 |xt) != '|\r') && |
|00000930| 69 73 73 70 61 63 65 28 | 63 29 29 0d 09 09 09 74 |isspace(|c))....t|
|00000940| 65 78 74 2b 2b 3b 0d 09 | 09 0d 09 09 69 66 20 28 |ext++;..|....if (|
|00000950| 63 20 3d 3d 20 27 23 27 | 29 0d 09 09 7b 0d 09 09 |c == '#'|)...{...|
|00000960| 09 2f 2a 20 70 72 65 70 | 72 6f 63 65 73 73 6f 72 |./* prep|rocessor|
|00000970| 20 64 69 72 65 63 74 69 | 76 65 20 2a 2f 0d 09 09 | directi|ve */...|
|00000980| 09 0d 09 09 09 74 65 78 | 74 2b 2b 3b 0d 09 09 09 |.....tex|t++;....|
|00000990| 0d 09 09 09 2f 2a 20 73 | 6b 69 70 20 77 68 69 74 |..../* s|kip whit|
|000009a0| 65 20 73 70 61 63 65 20 | 2a 2f 0d 09 09 09 77 68 |e space |*/....wh|
|000009b0| 69 6c 65 20 28 28 28 63 | 20 3d 20 2a 74 65 78 74 |ile (((c| = *text|
|000009c0| 29 20 21 3d 20 27 5c 72 | 27 29 20 26 26 20 69 73 |) != '\r|') && is|
|000009d0| 73 70 61 63 65 28 63 29 | 29 0d 09 09 09 09 74 65 |space(c)|).....te|
|000009e0| 78 74 2b 2b 3b 0d 09 09 | 09 0d 09 09 09 69 66 20 |xt++;...|.....if |
|000009f0| 28 73 74 72 6e 63 6d 70 | 28 74 65 78 74 2c 20 69 |(strncmp|(text, i|
|00000a00| 6e 63 6c 74 6f 6b 2c 20 | 69 6e 63 6c 6c 65 6e 29 |ncltok, |incllen)|
|00000a10| 20 3d 3d 20 30 29 0d 09 | 09 09 7b 0d 09 09 09 09 | == 0)..|..{.....|
|00000a20| 63 68 61 72 09 64 65 6c | 69 6d 09 3d 20 27 5c 30 |char.del|im.= '\0|
|00000a30| 27 3b 0d 09 09 09 09 0d | 09 09 09 09 2f 2a 20 77 |';......|..../* w|
|00000a40| 65 20 68 61 76 65 20 23 | 69 6e 63 6c 75 64 65 20 |e have #|include |
|00000a50| 2a 2f 0d 09 09 09 09 74 | 65 78 74 20 2b 3d 20 69 |*/.....t|ext += i|
|00000a60| 6e 63 6c 6c 65 6e 3b 0d | 09 09 09 09 0d 09 09 09 |ncllen;.|........|
|00000a70| 09 2f 2a 20 73 6b 69 70 | 20 77 68 69 74 65 20 73 |./* skip| white s|
|00000a80| 70 61 63 65 20 28 62 75 | 74 20 6e 6f 74 20 63 61 |pace (bu|t not ca|
|00000a90| 72 72 69 61 67 65 20 72 | 65 74 75 72 6e 73 29 20 |rriage r|eturns) |
|00000aa0| 2a 2f 0d 09 09 09 09 77 | 68 69 6c 65 20 28 28 28 |*/.....w|hile (((|
|00000ab0| 63 20 3d 20 2a 74 65 78 | 74 29 20 21 3d 20 27 5c |c = *tex|t) != '\|
|00000ac0| 72 27 29 20 26 26 20 69 | 73 73 70 61 63 65 28 63 |r') && i|sspace(c|
|00000ad0| 29 29 0d 09 09 09 09 09 | 74 65 78 74 2b 2b 3b 0d |))......|text++;.|
|00000ae0| 09 09 09 09 0d 09 09 09 | 09 69 66 20 28 63 20 3d |........|.if (c =|
|00000af0| 3d 20 27 22 27 29 0d 09 | 09 09 09 09 64 65 6c 69 |= '"')..|....deli|
|00000b00| 6d 20 3d 20 27 22 27 3b | 0d 09 09 09 09 65 6c 73 |m = '"';|.....els|
|00000b10| 65 20 69 66 20 28 63 20 | 3d 3d 20 27 3c 27 29 0d |e if (c |== '<').|
|00000b20| 09 09 09 09 09 64 65 6c | 69 6d 20 3d 20 27 3e 27 |.....del|im = '>'|
|00000b30| 3b 0d 09 09 09 09 0d 09 | 09 09 09 69 66 20 28 64 |;.......|...if (d|
|00000b40| 65 6c 69 6d 20 21 3d 20 | 27 5c 30 27 29 0d 09 09 |elim != |'\0')...|
|00000b50| 09 09 7b 0d 09 09 09 09 | 09 2f 2a 20 77 65 20 68 |..{.....|./* we h|
|00000b60| 61 76 65 20 23 69 6e 63 | 6c 75 64 65 20 22 22 20 |ave #inc|lude "" |
|00000b70| 6f 72 20 23 69 6e 63 6c | 75 64 65 20 3c 3e 20 2a |or #incl|ude <> *|
|00000b80| 2f 0d 09 09 09 09 09 0d | 09 09 09 09 09 63 6f 6e |/.......|.....con|
|00000b90| 73 74 20 63 68 61 72 2a | 09 73 74 61 72 74 3b 0d |st char*|.start;.|
|00000ba0| 09 09 09 09 09 63 6f 6e | 73 74 20 63 68 61 72 2a |.....con|st char*|
|00000bb0| 09 65 6e 64 3b 0d 09 09 | 09 09 09 63 68 61 72 09 |.end;...|...char.|
|00000bc0| 09 69 6e 63 6c 6e 61 6d | 65 5b 31 30 30 5d 3b 0d |.inclnam|e[100];.|
|00000bd0| 09 09 09 09 09 0d 09 09 | 09 09 09 73 74 61 72 74 |........|...start|
|00000be0| 20 3d 20 2b 2b 74 65 78 | 74 3b 0d 09 09 09 09 09 | = ++tex|t;......|
|00000bf0| 65 6e 64 20 3d 20 73 74 | 72 63 68 72 28 73 74 61 |end = st|rchr(sta|
|00000c00| 72 74 2c 20 64 65 6c 69 | 6d 29 3b 0d 09 09 09 09 |rt, deli|m);.....|
|00000c10| 09 0d 09 09 09 09 09 69 | 66 20 28 65 6e 64 20 21 |.......i|f (end !|
|00000c20| 3d 20 4e 55 4c 4c 29 0d | 09 09 09 09 09 7b 0d 09 |= NULL).|.....{..|
|00000c30| 09 09 09 09 09 2f 2a 20 | 77 65 20 68 61 76 65 20 |...../* |we have |
|00000c40| 61 6e 20 23 69 6e 63 6c | 75 64 65 20 66 69 6c 65 |an #incl|ude file|
|00000c50| 20 6e 61 6d 65 21 20 2a | 2f 0d 09 09 09 09 09 09 | name! *|/.......|
|00000c60| 0d 09 09 09 09 09 09 69 | 66 20 28 65 6e 64 20 2d |.......i|f (end -|
|00000c70| 20 73 74 61 72 74 20 3e | 3d 20 73 69 7a 65 6f 66 | start >|= sizeof|
|00000c80| 28 69 6e 63 6c 6e 61 6d | 65 29 29 0d 09 09 09 09 |(inclnam|e)).....|
|00000c90| 09 09 09 65 6e 64 20 3d | 20 73 74 61 72 74 20 2b |...end =| start +|
|00000ca0| 20 73 69 7a 65 6f 66 28 | 69 6e 63 6c 6e 61 6d 65 | sizeof(|inclname|
|00000cb0| 29 20 2b 20 31 3b 0d 09 | 09 09 09 09 09 0d 09 09 |) + 1;..|........|
|00000cc0| 09 09 09 09 6d 65 6d 63 | 70 79 28 69 6e 63 6c 6e |....memc|py(incln|
|00000cd0| 61 6d 65 2c 20 73 74 61 | 72 74 2c 20 65 6e 64 20 |ame, sta|rt, end |
|00000ce0| 2d 20 73 74 61 72 74 29 | 3b 0d 09 09 09 09 09 09 |- start)|;.......|
|00000cf0| 69 6e 63 6c 6e 61 6d 65 | 5b 65 6e 64 20 2d 20 73 |inclname|[end - s|
|00000d00| 74 61 72 74 5d 20 3d 20 | 27 5c 30 27 3b 0d 09 09 |tart] = |'\0';...|
|00000d10| 09 09 09 09 0d 09 09 09 | 09 09 09 65 72 72 20 3d |........|...err =|
|00000d20| 20 49 6e 63 6c 75 64 65 | 46 69 6c 65 28 73 74 61 | Include|File(sta|
|00000d30| 74 75 73 2c 20 69 6e 63 | 6c 6e 61 6d 65 2c 20 28 |tus, inc|lname, (|
|00000d40| 64 65 6c 69 6d 20 3d 3d | 20 27 22 27 29 29 3b 0d |delim ==| '"'));.|
|00000d50| 09 09 09 09 09 09 0d 09 | 09 09 09 09 09 74 65 78 |........|.....tex|
|00000d60| 74 20 3d 20 65 6e 64 3b | 0d 09 09 09 09 09 7d 0d |t = end;|......}.|
|00000d70| 09 09 09 09 7d 0d 09 09 | 09 7d 0d 09 09 7d 0d 09 |....}...|.}...}..|
|00000d80| 09 0d 09 09 2f 2a 20 73 | 6b 69 70 20 74 6f 20 65 |..../* s|kip to e|
|00000d90| 6e 64 2d 6f 66 2d 6c 69 | 6e 65 20 2a 2f 0d 09 09 |nd-of-li|ne */...|
|00000da0| 77 68 69 6c 65 20 28 28 | 63 20 3d 20 2a 74 65 78 |while ((|c = *tex|
|00000db0| 74 29 20 21 3d 20 27 5c | 72 27 29 0d 09 09 09 74 |t) != '\|r')....t|
|00000dc0| 65 78 74 2b 2b 3b 0d 09 | 09 0d 09 09 69 66 20 28 |ext++;..|....if (|
|00000dd0| 63 20 3d 3d 20 27 5c 72 | 27 29 0d 09 09 7b 0d 09 |c == '\r|')...{..|
|00000de0| 09 09 2f 2a 20 73 74 61 | 72 74 20 61 20 6e 65 77 |../* sta|rt a new|
|00000df0| 20 6c 69 6e 65 20 2a 2f | 0d 09 09 09 0d 09 09 09 | line */|........|
|00000e00| 74 65 78 74 2b 2b 3b 0d | 09 09 09 73 74 61 74 75 |text++;.|...statu|
|00000e10| 73 2d 3e 6c 69 6e 65 63 | 6f 75 6e 74 2b 2b 3b 0d |s->linec|ount++;.|
|00000e20| 09 09 09 0d 09 09 09 69 | 66 20 28 28 73 74 61 74 |.......i|f ((stat|
|00000e30| 75 73 2d 3e 6c 69 6e 65 | 63 6f 75 6e 74 20 3d 3d |us->line|count ==|
|00000e40| 20 31 29 20 7c 7c 20 28 | 73 74 61 74 75 73 2d 3e | 1) || (|status->|
|00000e50| 6c 69 6e 65 63 6f 75 6e | 74 20 25 20 35 30 20 3d |linecoun|t % 50 =|
|00000e60| 3d 20 30 29 29 0d 09 09 | 09 7b 0d 09 09 09 09 2f |= 0))...|.{...../|
|00000e70| 2a 0d 09 09 09 09 20 2a | 09 57 65 20 64 6f 6e 27 |*..... *|.We don'|
|00000e80| 74 20 77 61 6e 74 20 74 | 6f 20 63 61 6c 6c 20 74 |t want t|o call t|
|00000e90| 68 69 73 20 66 6f 72 20 | 65 76 65 72 79 20 6c 69 |his for |every li|
|00000ea0| 6e 65 2c 20 0d 09 09 09 | 09 20 2a 09 27 63 61 75 |ne, ....|. *.'cau|
|00000eb0| 73 65 20 69 74 20 77 69 | 6c 6c 20 73 6c 6f 77 20 |se it wi|ll slow |
|00000ec0| 64 6f 77 6e 20 63 6f 6d | 70 69 6c 61 74 69 6f 6e |down com|pilation|
|00000ed0| 20 74 6f 20 61 20 63 72 | 61 77 6c 2e 0d 09 09 09 | to a cr|awl.....|
|00000ee0| 09 20 2a 2f 0d 09 09 09 | 09 0d 09 09 09 09 65 72 |. */....|......er|
|00000ef0| 72 20 3d 20 43 57 43 6f | 6d 70 44 69 73 70 6c 61 |r = CWCo|mpDispla|
|00000f00| 79 4c 69 6e 65 73 28 73 | 74 61 74 75 73 2d 3e 63 |yLines(s|tatus->c|
|00000f10| 70 62 2c 20 73 74 61 74 | 75 73 2d 3e 6c 69 6e 65 |pb, stat|us->line|
|00000f20| 63 6f 75 6e 74 29 3b 0d | 09 09 09 7d 0d 09 09 09 |count);.|...}....|
|00000f30| 0d 09 09 09 63 6f 6e 74 | 69 6e 75 65 3b 0d 09 09 |....cont|inue;...|
|00000f40| 7d 0d 09 7d 0d 09 09 0d | 09 72 65 74 75 72 6e 20 |}..}....|.return |
|00000f50| 65 72 72 3b 0d 7d 0d 0d | 0d 73 74 61 74 69 63 20 |err;.}..|.static |
|00000f60| 4f 53 45 72 72 09 49 6e | 63 6c 75 64 65 46 69 6c |OSErr.In|cludeFil|
|00000f70| 65 28 54 6f 6f 6c 46 72 | 6f 6e 74 45 6e 64 53 74 |e(ToolFr|ontEndSt|
|00000f80| 61 74 75 73 2a 20 73 74 | 61 74 75 73 2c 20 63 6f |atus* st|atus, co|
|00000f90| 6e 73 74 20 63 68 61 72 | 2a 20 69 6e 63 6c 6e 61 |nst char|* inclna|
|00000fa0| 6d 65 2c 20 42 6f 6f 6c | 65 61 6e 20 66 75 6c 6c |me, Bool|ean full|
|00000fb0| 53 65 61 72 63 68 29 0d | 7b 0d 09 46 53 53 70 65 |Search).|{..FSSpe|
|00000fc0| 63 09 73 70 65 63 3b 0d | 09 48 61 6e 64 6c 65 09 |c.spec;.|.Handle.|
|00000fd0| 68 61 6e 64 3b 0d 09 6c | 6f 6e 67 09 73 69 7a 65 |hand;..l|ong.size|
|00000fe0| 3b 0d 09 53 74 72 32 35 | 35 09 70 6e 61 6d 65 3b |;..Str25|5.pname;|
|00000ff0| 0d 09 42 6f 6f 6c 65 61 | 6e 09 61 6c 72 65 61 64 |..Boolea|n.alread|
|00001000| 79 69 6e 63 6c 75 64 65 | 64 3b 0d 09 4f 53 45 72 |yinclude|d;..OSEr|
|00001010| 72 09 65 72 72 3b 0d 09 | 69 6e 74 09 09 69 3b 0d |r.err;..|int..i;.|
|00001020| 09 09 0d 09 2f 2f 20 63 | 6f 6e 76 65 72 74 20 43 |....// c|onvert C|
|00001030| 20 73 74 72 69 6e 67 20 | 74 6f 20 70 61 73 63 61 | string |to pasca|
|00001040| 6c 0d 09 66 6f 72 20 28 | 69 20 3d 20 30 3b 20 69 |l..for (|i = 0; i|
|00001050| 6e 63 6c 6e 61 6d 65 5b | 69 5d 20 21 3d 20 30 20 |nclname[|i] != 0 |
|00001060| 26 26 20 69 20 3c 20 32 | 35 35 3b 20 69 2b 2b 29 |&& i < 2|55; i++)|
|00001070| 0d 09 09 70 6e 61 6d 65 | 5b 69 20 2b 20 31 5d 20 |...pname|[i + 1] |
|00001080| 3d 20 69 6e 63 6c 6e 61 | 6d 65 5b 69 5d 3b 0d 09 |= inclna|me[i];..|
|00001090| 70 6e 61 6d 65 5b 30 5d | 20 3d 20 69 3b 0d 09 0d |pname[0]| = i;...|
|000010a0| 09 2f 2a 20 6c 6f 63 61 | 74 65 20 74 68 65 20 66 |./* loca|te the f|
|000010b0| 69 6c 65 20 6e 61 6d 65 | 20 75 73 69 6e 67 20 74 |ile name| using t|
|000010c0| 68 65 20 70 72 6f 6a 65 | 63 74 27 73 20 61 63 63 |he proje|ct's acc|
|000010d0| 65 73 73 20 70 61 74 68 | 73 20 2a 2f 0d 09 65 72 |ess path|s */..er|
|000010e0| 72 20 3d 20 43 57 43 6f | 6d 70 46 69 6e 64 49 6e |r = CWCo|mpFindIn|
|000010f0| 63 6c 75 64 65 46 69 6c | 65 28 73 74 61 74 75 73 |cludeFil|e(status|
|00001100| 2d 3e 63 70 62 2c 20 70 | 6e 61 6d 65 2c 20 66 75 |->cpb, p|name, fu|
|00001110| 6c 6c 53 65 61 72 63 68 | 2c 20 26 68 61 6e 64 2c |llSearch|, &hand,|
|00001120| 20 26 73 69 7a 65 2c 20 | 26 73 70 65 63 2c 20 0d | &size, |&spec, .|
|00001130| 09 09 09 09 09 09 09 09 | 26 61 6c 72 65 61 64 79 |........|&already|
|00001140| 69 6e 63 6c 75 64 65 64 | 2c 20 66 61 6c 73 65 29 |included|, false)|
|00001150| 3b 0d 09 09 09 09 09 09 | 09 09 0d 09 69 66 20 28 |;.......|....if (|
|00001160| 65 72 72 20 3d 3d 20 6e | 6f 45 72 72 20 26 26 20 |err == n|oErr && |
|00001170| 21 61 6c 72 65 61 64 79 | 69 6e 63 6c 75 64 65 64 |!already|included|
|00001180| 29 0d 09 7b 0d 09 09 2f | 2f 20 61 64 64 20 74 68 |)..{.../|/ add th|
|00001190| 65 20 66 6f 6c 64 65 72 | 20 6f 66 20 74 68 69 73 |e folder| of this|
|000011a0| 20 66 69 6c 65 20 74 6f | 20 74 68 65 20 73 65 61 | file to| the sea|
|000011b0| 72 63 68 20 70 61 74 68 | 20 61 72 67 75 6d 65 6e |rch path| argumen|
|000011c0| 74 20 6c 69 73 74 0d 09 | 09 69 6e 74 20 69 3b 0d |t list..|.int i;.|
|000011d0| 09 09 42 6f 6f 6c 65 61 | 6e 20 66 6f 75 6e 64 20 |..Boolea|n found |
|000011e0| 3d 20 66 61 6c 73 65 3b | 0d 09 09 0d 09 09 2f 2f |= false;|......//|
|000011f0| 20 44 65 62 75 67 53 74 | 72 28 70 6e 61 6d 65 29 | DebugSt|r(pname)|
|00001200| 3b 0d 09 09 0d 09 09 66 | 6f 72 20 28 69 20 3d 20 |;......f|or (i = |
|00001210| 30 3b 20 69 20 3c 20 73 | 74 61 74 75 73 2d 3e 6e |0; i < s|tatus->n|
|00001220| 75 6d 46 6f 6c 64 65 72 | 50 61 74 68 73 3b 20 69 |umFolder|Paths; i|
|00001230| 2b 2b 29 0d 09 09 7b 0d | 09 09 09 2f 2f 20 63 6f |++)...{.|...// co|
|00001240| 6d 70 61 72 65 20 74 68 | 65 20 76 52 65 66 4e 75 |mpare th|e vRefNu|
|00001250| 6d 20 61 6e 64 20 70 61 | 72 49 44 0d 09 09 09 69 |m and pa|rID....i|
|00001260| 66 20 28 73 70 65 63 2e | 76 52 65 66 4e 75 6d 20 |f (spec.|vRefNum |
|00001270| 3d 3d 20 73 74 61 74 75 | 73 2d 3e 66 6f 6c 64 65 |== statu|s->folde|
|00001280| 72 50 61 74 68 73 5b 69 | 5d 2e 76 52 65 66 4e 75 |rPaths[i|].vRefNu|
|00001290| 6d 0d 09 09 09 20 20 20 | 20 26 26 20 73 70 65 63 |m.... | && spec|
|000012a0| 2e 70 61 72 49 44 20 3d | 3d 20 73 74 61 74 75 73 |.parID =|= status|
|000012b0| 2d 3e 66 6f 6c 64 65 72 | 50 61 74 68 73 5b 69 5d |->folder|Paths[i]|
|000012c0| 2e 64 69 72 49 44 29 0d | 09 09 09 7b 0d 09 09 09 |.dirID).|...{....|
|000012d0| 09 66 6f 75 6e 64 20 3d | 20 74 72 75 65 3b 0d 09 |.found =| true;..|
|000012e0| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 7d 0d 09 |...break|;....}..|
|000012f0| 09 7d 0d 09 09 0d 09 09 | 69 66 20 28 21 66 6f 75 |.}......|if (!fou|
|00001300| 6e 64 29 0d 09 09 7b 0d | 09 09 09 2f 2f 20 6e 6f |nd)...{.|...// no|
|00001310| 74 20 61 6c 72 65 61 64 | 79 20 69 6e 20 6c 69 73 |t alread|y in lis|
|00001320| 74 20 2d 2d 20 61 64 64 | 20 69 74 0d 09 09 09 48 |t -- add| it....H|
|00001330| 61 6e 64 6c 65 20 64 69 | 72 4e 61 6d 65 3b 0d 09 |andle di|rName;..|
|00001340| 09 09 73 68 6f 72 74 20 | 64 69 72 4e 61 6d 65 4c |..short |dirNameL|
|00001350| 65 6e 67 74 68 3b 0d 09 | 09 09 0d 09 09 09 69 66 |ength;..|......if|
|00001360| 20 28 73 74 61 74 75 73 | 2d 3e 6e 75 6d 46 6f 6c | (status|->numFol|
|00001370| 64 65 72 50 61 74 68 73 | 20 3e 3d 20 4d 41 58 46 |derPaths| >= MAXF|
|00001380| 4f 4c 44 45 52 50 41 54 | 48 53 29 0d 09 09 09 7b |OLDERPAT|HS)....{|
|00001390| 0d 09 09 09 09 2f 2f 20 | 74 6f 6f 20 6d 61 6e 79 |.....// |too many|
|000013a0| 20 66 6f 6c 64 65 72 73 | 20 65 72 72 6f 72 20 2d | folders| error -|
|000013b0| 2d 20 66 61 74 20 63 68 | 61 6e 63 65 21 0d 09 09 |- fat ch|ance!...|
|000013c0| 09 09 43 57 43 6f 6d 70 | 45 72 72 6f 72 4d 65 73 |..CWComp|ErrorMes|
|000013d0| 73 61 67 65 28 73 74 61 | 74 75 73 2d 3e 63 70 62 |sage(sta|tus->cpb|
|000013e0| 2c 20 22 54 6f 6f 20 6d | 61 6e 79 20 69 6e 63 6c |, "Too m|any incl|
|000013f0| 75 64 65 20 66 69 6c 65 | 20 66 6f 6c 64 65 72 73 |ude file| folders|
|00001400| 2e 22 29 3b 0d 09 09 09 | 09 65 72 72 20 3d 20 70 |.");....|.err = p|
|00001410| 61 72 61 6d 45 72 72 3b | 0d 0d 09 09 09 7d 0d 0d |aramErr;|.....}..|
|00001420| 09 09 09 2f 2f 20 61 64 | 64 20 74 6f 20 6c 69 73 |...// ad|d to lis|
|00001430| 74 0d 09 09 09 69 66 20 | 28 65 72 72 20 3d 3d 20 |t....if |(err == |
|00001440| 6e 6f 45 72 72 29 0d 09 | 09 09 09 65 72 72 20 3d |noErr)..|...err =|
|00001450| 20 47 65 74 46 75 6c 6c | 50 61 74 68 28 73 70 65 | GetFull|Path(spe|
|00001460| 63 2e 76 52 65 66 4e 75 | 6d 2c 20 73 70 65 63 2e |c.vRefNu|m, spec.|
|00001470| 70 61 72 49 44 2c 20 4e | 55 4c 4c 2c 20 26 64 69 |parID, N|ULL, &di|
|00001480| 72 4e 61 6d 65 4c 65 6e | 67 74 68 2c 20 26 64 69 |rNameLen|gth, &di|
|00001490| 72 4e 61 6d 65 29 3b 0d | 09 09 09 69 66 20 28 65 |rName);.|...if (e|
|000014a0| 72 72 20 3d 3d 20 6e 6f | 45 72 72 29 0d 09 09 09 |rr == no|Err)....|
|000014b0| 7b 0d 09 09 09 09 73 74 | 61 74 75 73 2d 3e 66 6f |{.....st|atus->fo|
|000014c0| 6c 64 65 72 50 61 74 68 | 73 5b 73 74 61 74 75 73 |lderPath|s[status|
|000014d0| 2d 3e 6e 75 6d 46 6f 6c | 64 65 72 50 61 74 68 73 |->numFol|derPaths|
|000014e0| 5d 2e 70 61 74 68 20 3d | 20 64 69 72 4e 61 6d 65 |].path =| dirName|
|000014f0| 3b 0d 09 09 09 09 73 74 | 61 74 75 73 2d 3e 66 6f |;.....st|atus->fo|
|00001500| 6c 64 65 72 50 61 74 68 | 73 5b 73 74 61 74 75 73 |lderPath|s[status|
|00001510| 2d 3e 6e 75 6d 46 6f 6c | 64 65 72 50 61 74 68 73 |->numFol|derPaths|
|00001520| 5d 2e 76 52 65 66 4e 75 | 6d 20 3d 20 73 70 65 63 |].vRefNu|m = spec|
|00001530| 2e 76 52 65 66 4e 75 6d | 3b 0d 09 09 09 09 73 74 |.vRefNum|;.....st|
|00001540| 61 74 75 73 2d 3e 66 6f | 6c 64 65 72 50 61 74 68 |atus->fo|lderPath|
|00001550| 73 5b 73 74 61 74 75 73 | 2d 3e 6e 75 6d 46 6f 6c |s[status|->numFol|
|00001560| 64 65 72 50 61 74 68 73 | 5d 2e 64 69 72 49 44 20 |derPaths|].dirID |
|00001570| 3d 20 73 70 65 63 2e 70 | 61 72 49 44 3b 0d 09 09 |= spec.p|arID;...|
|00001580| 09 09 2b 2b 73 74 61 74 | 75 73 2d 3e 6e 75 6d 46 |..++stat|us->numF|
|00001590| 6f 6c 64 65 72 50 61 74 | 68 73 3b 0d 09 09 09 7d |olderPat|hs;....}|
|000015a0| 0d 09 09 7d 0d 09 09 0d | 09 09 65 72 72 20 3d 20 |...}....|..err = |
|000015b0| 50 72 6f 63 65 73 73 46 | 69 6c 65 28 73 74 61 74 |ProcessF|ile(stat|
|000015c0| 75 73 2c 20 26 73 70 65 | 63 2c 20 68 61 6e 64 2c |us, &spe|c, hand,|
|000015d0| 20 73 69 7a 65 2c 20 74 | 72 75 65 29 3b 0d 09 7d | size, t|rue);..}|
|000015e0| 0d 09 65 6c 73 65 20 69 | 66 20 28 65 72 72 20 3d |..else i|f (err =|
|000015f0| 3d 20 66 6e 66 45 72 72 | 29 0d 09 7b 0d 09 09 65 |= fnfErr|)..{...e|
|00001600| 72 72 20 3d 20 6e 6f 45 | 72 72 3b 20 2f 2f 20 69 |rr = noE|rr; // i|
|00001610| 74 27 73 20 6e 6f 74 20 | 72 65 61 6c 6c 79 20 61 |t's not |really a|
|00001620| 6e 20 65 72 72 6f 72 20 | 2d 2d 20 61 6e 64 20 49 |n error |-- and I|
|00001630| 20 64 6f 6e 27 74 20 73 | 65 65 20 61 20 43 57 20 | don't s|ee a CW |
|00001640| 77 61 72 6e 69 6e 67 20 | 41 50 49 2e 2e 2e 2e 0d |warning |API.....|
|00001650| 23 69 66 20 30 0d 09 09 | 63 68 61 72 09 65 72 72 |#if 0...|char.err|
|00001660| 6d 73 67 5b 32 30 30 5d | 3b 0d 09 09 0d 09 09 73 |msg[200]|;......s|
|00001670| 70 72 69 6e 74 66 28 65 | 72 72 6d 73 67 2c 20 22 |printf(e|rrmsg, "|
|00001680| 43 61 6e 27 74 20 6c 6f | 63 61 74 65 20 66 69 6c |Can't lo|cate fil|
|00001690| 65 20 5c 22 25 73 5c 22 | 2e 22 2c 20 69 6e 63 6c |e \"%s\"|.", incl|
|000016a0| 6e 61 6d 65 29 3b 0d 09 | 09 0d 09 09 65 72 72 20 |name);..|....err |
|000016b0| 3d 20 43 57 43 6f 6d 70 | 45 72 72 6f 72 4d 65 73 |= CWComp|ErrorMes|
|000016c0| 73 61 67 65 28 73 74 61 | 74 75 73 2d 3e 63 70 62 |sage(sta|tus->cpb|
|000016d0| 2c 20 65 72 72 6d 73 67 | 29 3b 0d 23 65 6e 64 69 |, errmsg|);.#endi|
|000016e0| 66 0d 09 7d 0d 09 0d 09 | 72 65 74 75 72 6e 20 28 |f..}....|return (|
|000016f0| 65 72 72 29 3b 0d 7d 0d | 0d 0d 73 74 61 74 69 63 |err);.}.|..static|
|00001700| 20 4f 53 45 72 72 09 52 | 65 61 64 4f 6e 65 46 69 | OSErr.R|eadOneFi|
|00001710| 6c 65 28 54 6f 6f 6c 46 | 72 6f 6e 74 45 6e 64 53 |le(ToolF|rontEndS|
|00001720| 74 61 74 75 73 2a 20 73 | 74 61 74 75 73 2c 20 63 |tatus* s|tatus, c|
|00001730| 6f 6e 73 74 20 46 53 53 | 70 65 63 2a 20 73 70 65 |onst FSS|pec* spe|
|00001740| 63 2c 20 0d 09 09 09 09 | 09 09 09 48 61 6e 64 6c |c, .....|...Handl|
|00001750| 65 20 68 61 6e 64 2c 20 | 6c 6f 6e 67 20 73 69 7a |e hand, |long siz|
|00001760| 65 2c 20 42 6f 6f 6c 65 | 61 6e 20 69 73 49 6e 63 |e, Boole|an isInc|
|00001770| 6c 75 64 65 46 69 6c 65 | 2c 20 48 61 6e 64 6c 65 |ludeFile|, Handle|
|00001780| 2a 20 74 65 78 74 70 29 | 0d 7b 0d 09 42 6f 6f 6c |* textp)|.{..Bool|
|00001790| 65 61 6e 09 74 65 78 74 | 49 73 43 61 63 68 65 64 |ean.text|IsCached|
|000017a0| 09 3d 20 66 61 6c 73 65 | 3b 0d 09 48 61 6e 64 6c |.= false|;..Handl|
|000017b0| 65 09 74 65 78 74 3b 0d | 09 4f 53 45 72 72 09 65 |e.text;.|.OSErr.e|
|000017c0| 72 72 3b 0d 09 0d 09 69 | 66 20 28 68 61 6e 64 20 |rr;....i|f (hand |
|000017d0| 21 3d 20 4e 55 4c 4c 29 | 0d 09 7b 0d 09 09 2f 2a |!= NULL)|..{.../*|
|000017e0| 0d 09 09 20 2a 09 54 68 | 65 20 66 69 6c 65 20 69 |... *.Th|e file i|
|000017f0| 73 20 6f 70 65 6e 20 69 | 6e 20 74 68 65 20 65 64 |s open i|n the ed|
|00001800| 69 74 6f 72 2e 20 20 57 | 65 20 68 61 76 65 20 74 |itor. W|e have t|
|00001810| 6f 20 75 73 65 20 27 73 | 69 7a 65 27 20 74 6f 20 |o use 's|ize' to |
|00001820| 64 65 74 65 72 6d 69 6e | 65 20 74 68 65 20 0d 09 |determin|e the ..|
|00001830| 09 20 2a 09 6e 75 6d 62 | 65 72 20 6f 66 20 63 68 |. *.numb|er of ch|
|00001840| 61 72 61 63 74 65 72 73 | 20 74 6f 20 72 65 61 64 |aracters| to read|
|00001850| 2c 20 62 65 63 61 75 73 | 65 20 74 68 65 20 65 64 |, becaus|e the ed|
|00001860| 69 74 6f 72 20 6d 61 79 | 20 68 61 76 65 20 61 70 |itor may| have ap|
|00001870| 70 65 6e 64 65 64 20 73 | 6c 6f 70 20 0d 09 09 20 |pended s|lop ... |
|00001880| 2a 09 62 79 74 65 73 20 | 74 6f 20 74 68 65 20 65 |*.bytes |to the e|
|00001890| 6e 64 20 6f 66 20 74 68 | 65 20 74 65 78 74 2e 0d |nd of th|e text..|
|000018a0| 09 09 20 2a 0d 09 09 20 | 2a 09 46 6f 72 20 73 69 |.. *... |*.For si|
|000018b0| 6d 70 6c 69 63 69 74 79 | 27 73 20 73 61 6b 65 2c |mplicity|'s sake,|
|000018c0| 20 77 65 27 6c 6c 20 6a | 75 73 74 20 63 6f 70 79 | we'll j|ust copy|
|000018d0| 20 74 68 65 20 74 65 78 | 74 20 69 6e 74 6f 20 74 | the tex|t into t|
|000018e0| 68 65 20 74 65 6d 70 6f | 72 61 72 79 20 62 75 66 |he tempo|rary buf|
|000018f0| 66 65 72 2c 20 0d 09 09 | 20 2a 09 6a 75 73 74 20 |fer, ...| *.just |
|00001900| 61 73 20 77 65 20 64 6f | 20 66 6f 72 20 66 69 6c |as we do| for fil|
|00001910| 65 73 20 77 65 20 72 65 | 61 64 20 66 72 6f 6d 20 |es we re|ad from |
|00001920| 64 69 73 6b 2e 0d 09 09 | 20 2a 2f 0d 09 09 0d 09 |disk....| */.....|
|00001930| 09 74 65 78 74 20 3d 20 | 4e 65 77 48 61 6e 64 6c |.text = |NewHandl|
|00001940| 65 28 73 69 7a 65 2b 31 | 29 3b 0d 09 09 69 66 20 |e(size+1|);...if |
|00001950| 28 74 65 78 74 20 3d 3d | 20 4e 55 4c 4c 29 0d 09 |(text ==| NULL)..|
|00001960| 09 09 72 65 74 75 72 6e | 20 28 6d 65 6d 46 75 6c |..return| (memFul|
|00001970| 6c 45 72 72 29 3b 0d 09 | 09 0d 09 09 42 6c 6f 63 |lErr);..|....Bloc|
|00001980| 6b 4d 6f 76 65 44 61 74 | 61 28 2a 68 61 6e 64 2c |kMoveDat|a(*hand,|
|00001990| 20 2a 74 65 78 74 2c 20 | 73 69 7a 65 29 3b 0d 09 | *text, |size);..|
|000019a0| 09 28 2a 74 65 78 74 29 | 5b 73 69 7a 65 5d 20 3d |.(*text)|[size] =|
|000019b0| 20 27 5c 30 27 3b 0d 09 | 7d 0d 09 65 6c 73 65 0d | '\0';..|}..else.|
|000019c0| 09 7b 0d 09 09 2f 2a 0d | 09 09 20 2a 09 54 68 65 |.{.../*.|.. *.The|
|000019d0| 20 66 69 6c 65 20 69 73 | 6e 27 74 20 6f 70 65 6e | file is|n't open|
|000019e0| 20 69 6e 20 74 68 65 20 | 65 64 69 74 6f 72 2e 20 | in the |editor. |
|000019f0| 20 49 66 20 74 68 69 73 | 20 69 73 20 61 6e 20 69 | If this| is an i|
|00001a00| 6e 63 6c 75 64 65 20 66 | 69 6c 65 2c 20 74 68 65 |nclude f|ile, the|
|00001a10| 6e 20 6c 6f 6f 6b 20 0d | 09 09 20 2a 09 66 6f 72 |n look .|.. *.for|
|00001a20| 20 69 74 20 69 6e 20 74 | 68 65 20 69 6e 63 6c 75 | it in t|he inclu|
|00001a30| 64 65 20 66 69 6c 65 20 | 63 61 63 68 65 2e 0d 09 |de file |cache...|
|00001a40| 09 20 2a 2f 0d 09 09 0d | 09 09 69 66 20 28 69 73 |. */....|..if (is|
|00001a50| 49 6e 63 6c 75 64 65 46 | 69 6c 65 20 26 26 20 73 |IncludeF|ile && s|
|00001a60| 74 61 74 75 73 2d 3e 63 | 70 62 2d 3e 63 61 63 68 |tatus->c|pb->cach|
|00001a70| 69 6e 67 5f 69 6e 63 6c | 75 64 65 73 29 0d 09 09 |ing_incl|udes)...|
|00001a80| 7b 0d 09 09 09 65 72 72 | 20 3d 20 43 57 43 6f 6d |{....err| = CWCom|
|00001a90| 70 47 65 74 43 61 63 68 | 65 64 49 6e 63 6c 75 64 |pGetCach|edInclud|
|00001aa0| 65 46 69 6c 65 28 73 74 | 61 74 75 73 2d 3e 63 70 |eFile(st|atus->cp|
|00001ab0| 62 2c 20 73 70 65 63 2c | 20 26 74 65 78 74 29 3b |b, spec,| &text);|
|00001ac0| 0d 09 09 09 74 65 78 74 | 49 73 43 61 63 68 65 64 |....text|IsCached|
|00001ad0| 20 3d 20 28 65 72 72 20 | 3d 3d 20 6e 6f 45 72 72 | = (err |== noErr|
|00001ae0| 29 3b 0d 09 09 7d 0d 09 | 09 65 6c 73 65 0d 09 09 |);...}..|.else...|
|00001af0| 09 65 72 72 20 3d 20 66 | 6e 66 45 72 72 3b 0d 09 |.err = f|nfErr;..|
|00001b00| 09 0d 09 09 69 66 20 28 | 65 72 72 20 21 3d 20 6e |....if (|err != n|
|00001b10| 6f 45 72 72 29 0d 09 09 | 7b 0d 09 09 09 2f 2a 0d |oErr)...|{..../*.|
|00001b20| 09 09 09 20 2a 09 54 68 | 65 20 66 69 6c 65 20 77 |... *.Th|e file w|
|00001b30| 61 73 20 69 6e 20 74 68 | 65 20 63 61 63 68 65 2c |as in th|e cache,|
|00001b40| 20 73 6f 20 77 65 27 6c | 6c 20 68 61 76 65 20 74 | so we'l|l have t|
|00001b50| 6f 20 68 69 74 20 74 68 | 65 20 64 69 73 6b 2e 0d |o hit th|e disk..|
|00001b60| 09 09 09 20 2a 2f 0d 09 | 09 09 0d 09 09 09 73 68 |... */..|......sh|
|00001b70| 6f 72 74 09 72 65 66 6e | 75 6d 3b 0d 09 09 09 0d |ort.refn|um;.....|
|00001b80| 09 09 09 65 72 72 20 3d | 20 46 53 70 4f 70 65 6e |...err =| FSpOpen|
|00001b90| 44 46 28 73 70 65 63 2c | 20 66 73 52 64 50 65 72 |DF(spec,| fsRdPer|
|00001ba0| 6d 2c 20 26 72 65 66 6e | 75 6d 29 3b 0d 09 09 09 |m, &refn|um);....|
|00001bb0| 69 66 20 28 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |if (err |!= noErr|
|00001bc0| 29 0d 09 09 09 09 72 65 | 74 75 72 6e 20 28 65 72 |).....re|turn (er|
|00001bd0| 72 29 3b 0d 09 09 09 0d | 09 09 09 65 72 72 20 3d |r);.....|...err =|
|00001be0| 20 47 65 74 45 4f 46 28 | 72 65 66 6e 75 6d 2c 20 | GetEOF(|refnum, |
|00001bf0| 26 73 69 7a 65 29 3b 0d | 09 09 09 69 66 20 28 65 |&size);.|...if (e|
|00001c00| 72 72 20 21 3d 20 6e 6f | 45 72 72 29 0d 09 09 09 |rr != no|Err)....|
|00001c10| 7b 0d 09 09 09 09 46 53 | 43 6c 6f 73 65 28 72 65 |{.....FS|Close(re|
|00001c20| 66 6e 75 6d 29 3b 0d 09 | 09 09 09 72 65 74 75 72 |fnum);..|...retur|
|00001c30| 6e 20 28 65 72 72 29 3b | 0d 09 09 09 7d 0d 09 09 |n (err);|....}...|
|00001c40| 09 0d 09 09 09 74 65 78 | 74 20 3d 20 4e 65 77 48 |.....tex|t = NewH|
|00001c50| 61 6e 64 6c 65 28 73 69 | 7a 65 2b 31 29 3b 0d 09 |andle(si|ze+1);..|
|00001c60| 09 09 69 66 20 28 74 65 | 78 74 20 3d 3d 20 4e 55 |..if (te|xt == NU|
|00001c70| 4c 4c 29 0d 09 09 09 7b | 0d 09 09 09 09 46 53 43 |LL)....{|.....FSC|
|00001c80| 6c 6f 73 65 28 72 65 66 | 6e 75 6d 29 3b 0d 09 09 |lose(ref|num);...|
|00001c90| 09 09 72 65 74 75 72 6e | 20 28 65 72 72 29 3b 0d |..return| (err);.|
|00001ca0| 09 09 09 7d 0d 09 09 09 | 0d 09 09 09 48 4c 6f 63 |...}....|....HLoc|
|00001cb0| 6b 28 74 65 78 74 29 3b | 0d 09 09 09 65 72 72 20 |k(text);|....err |
|00001cc0| 3d 20 46 53 52 65 61 64 | 28 72 65 66 6e 75 6d 2c |= FSRead|(refnum,|
|00001cd0| 20 26 73 69 7a 65 2c 20 | 2a 74 65 78 74 29 3b 0d | &size, |*text);.|
|00001ce0| 09 09 09 46 53 43 6c 6f | 73 65 28 72 65 66 6e 75 |...FSClo|se(refnu|
|00001cf0| 6d 29 3b 0d 09 09 09 0d | 09 09 09 69 66 20 28 65 |m);.....|...if (e|
|00001d00| 72 72 20 21 3d 20 6e 6f | 45 72 72 29 0d 09 09 09 |rr != no|Err)....|
|00001d10| 7b 0d 09 09 09 09 44 69 | 73 70 6f 73 65 48 61 6e |{.....Di|sposeHan|
|00001d20| 64 6c 65 28 74 65 78 74 | 29 3b 0d 09 09 09 09 72 |dle(text|);.....r|
|00001d30| 65 74 75 72 6e 20 28 65 | 72 72 29 3b 0d 09 09 09 |eturn (e|rr);....|
|00001d40| 7d 0d 09 09 09 0d 09 09 | 09 48 55 6e 6c 6f 63 6b |}.......|.HUnlock|
|00001d50| 28 74 65 78 74 29 3b 0d | 09 09 09 28 2a 74 65 78 |(text);.|...(*tex|
|00001d60| 74 29 5b 73 69 7a 65 5d | 20 3d 20 27 5c 30 27 3b |t)[size]| = '\0';|
|00001d70| 0d 09 09 7d 0d 09 7d 0d | 0d 09 2f 2a 0d 09 20 2a |...}..}.|../*.. *|
|00001d80| 09 41 74 20 74 68 69 73 | 20 70 6f 69 6e 74 2c 20 |.At this| point, |
|00001d90| 27 74 65 78 74 27 20 63 | 6f 6e 74 61 69 6e 73 20 |'text' c|ontains |
|00001da0| 61 20 6e 75 6c 6c 2d 74 | 65 72 6d 69 6e 61 74 65 |a null-t|erminate|
|00001db0| 64 20 76 65 72 73 69 6f | 6e 20 6f 66 20 6f 75 72 |d versio|n of our|
|00001dc0| 20 73 6f 75 72 63 65 20 | 66 69 6c 65 2e 0d 09 20 | source |file... |
|00001dd0| 2a 09 49 66 20 69 74 27 | 73 20 61 6e 20 69 6e 63 |*.If it'|s an inc|
|00001de0| 6c 75 64 65 20 66 69 6c | 65 20 74 68 61 74 20 68 |lude fil|e that h|
|00001df0| 61 73 6e 27 74 20 62 65 | 65 6e 20 63 61 63 68 65 |asn't be|en cache|
|00001e00| 64 20 61 6c 72 65 61 64 | 79 2c 20 74 68 65 6e 20 |d alread|y, then |
|00001e10| 63 61 63 68 65 20 69 74 | 2e 0d 09 20 2a 2f 0d 09 |cache it|... */..|
|00001e20| 0d 09 69 66 20 28 69 73 | 49 6e 63 6c 75 64 65 46 |..if (is|IncludeF|
|00001e30| 69 6c 65 20 26 26 20 73 | 74 61 74 75 73 2d 3e 63 |ile && s|tatus->c|
|00001e40| 70 62 2d 3e 63 61 63 68 | 69 6e 67 5f 69 6e 63 6c |pb->cach|ing_incl|
|00001e50| 75 64 65 73 20 26 26 20 | 21 74 65 78 74 49 73 43 |udes && |!textIsC|
|00001e60| 61 63 68 65 64 29 0d 09 | 7b 0d 09 09 65 72 72 20 |ached)..|{...err |
|00001e70| 3d 20 43 57 43 6f 6d 70 | 43 61 63 68 65 49 6e 63 |= CWComp|CacheInc|
|00001e80| 6c 75 64 65 46 69 6c 65 | 28 73 74 61 74 75 73 2d |ludeFile|(status-|
|00001e90| 3e 63 70 62 2c 20 73 70 | 65 63 2c 20 74 65 78 74 |>cpb, sp|ec, text|
|00001ea0| 29 3b 0d 09 7d 0d 09 0d | 09 2a 74 65 78 74 70 20 |);..}...|.*textp |
|00001eb0| 3d 20 74 65 78 74 3b 0d | 09 0d 09 72 65 74 75 72 |= text;.|...retur|
|00001ec0| 6e 20 28 6e 6f 45 72 72 | 29 3b 0d 7d 0d 00 00 00 |n (noErr|);.}....|
|00001ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f00| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00001f10| 4f 66 0c 48 6e fd fc 2f | 0b 4e ad 43 32 60 0c 48 |Of.Hn../|.N.C2`.H|
|00001f20| 7a 00 18 2f 0b 4e ad 01 | 3a 50 4f 4c ee 18 e0 fd |z../.N..|:POL....|
|00001f30| 10 44 65 66 61 75 6c 74 | 53 63 61 6e 6e 65 72 2e |.Default|Scanner.|
|00001f40| 63 6e 02 00 00 00 54 45 | 58 54 43 57 49 45 01 00 |cn....TE|XTCWIE..|
|00001f50| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 14 00 00 |..TEXTCW|IE......|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f70| 00 00 ac fb a8 77 00 00 | 1e 4d 00 00 01 9a 2e 00 |.....w..|.M......|
|00001f80| 0a 90 6e 00 0e 48 c0 2f | 00 4e ba ff b8 3e 00 be |..n..H./|.N...>..|
|00001f90| 46 6f 06 3a 06 3c 07 3e | 05 30 07 e2 40 d0 46 4c |Fo.:.<.>|.0..@.FL|
|00001fa0| ee 00 e0 ff f4 4e 5e 4e | 75 00 00 4e 56 00 00 2f |.....N^N|u..NV../|
|00001fb0| 0c 28 6e 00 08 20 0c 66 | 14 48 78 02 1a 48 6d 2c |.(n.. .f|.Hx..Hm,|
|00001fc0| ca 4e ad 01 82 28 40 20 | 0c 50 4f 67 10 2f 0c 4e |.N...(@ |.POg./.N|
|00001fd0| ad 35 22 28 40 20 54 41 | e8 01 1a 58 4f 20 0c 28 |.5"(@ TA|...XO .(|
|00001fe0| 6e ff fc 4e 5e 4e 75 4e | 56 00 00 2f 0c 28 6e 00 |n..N^NuN|V../.(n.|
|00001ff0| 08 2f 0c 4e ad 0e 4a 20 | 54 11 7c 00 01 00 46 20 |./.N..J |T.|...F |
|00002000| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002020| 00 00 00 00 00 00 00 03 | 00 04 00 28 00 0a 01 c2 |........|...(....|
|00002030| 02 80 00 28 00 0a 01 c2 | 02 80 ad 4f ea 01 00 00 |...(....|...O....|
|00002040| 15 a3 00 00 15 a3 00 00 | 12 73 01 00 00 00 00 04 |........|.s......|
|00002050| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00002060| 00 00 00 46 02 1c a7 98 | 41 5e 00 00 00 1c 00 46 |...F....|A^.....F|
|00002070| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00002080| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00002090| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|000020a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+